<div style="width:600px;margin:30px auto 10px auto;" *ngIf="auth.token.userRoleType=='0'">
  <nz-upload [nzBeforeUpload]="beforeUpload" [nzCustomRequest]="bindingFormFile" [nzMultiple]="true" (nzChange)="handleChange($event)"
    [nzFileList]="fileList">
    <button nz-button>
      <i class="anticon anticon-upload"></i><span>选择文件</span>
    </button>
  </nz-upload>
  <button nz-button [nzType]="'primary'" [nzLoading]="uploading" (click)="handleUpload()" [disabled]="fileList.length == 0"
    style="margin-top: 16px">
    {{ uploading ? '文件上传中...' : '上传选中文件' }}
  </button>
</div>

<div style="width:600px;margin:30px auto 10px auto;">
  <nz-list [nzDataSource]="serverFiles" nzBordered [nzHeader]="'已上传文件列表'" [nzRenderItem]="item" [nzItemLayout]="'horizontal'"
    [nzLoading]="loading">
    <ng-template #item let-item>
      <nz-list-item [nzActions]="[deleteAction]">
        <ng-template #deleteAction>
          <a *ngIf="auth.token.userRoleType=='0'" (click)="deleteFile(item.id)"><i class="anticon anticon-close-square-o"></i></a>
        </ng-template>
        <nz-list-item-meta [nzTitle]="nzTitle" [nzAvatar]="nzAvatar">
          <ng-template #nzTitle>
            <a  [href]="httpService.IP_PORT+item.filePath" target="_blank">{{item.fileName}}</a>
          </ng-template>
        </nz-list-item-meta>
      </nz-list-item>
    </ng-template>
  </nz-list>
</div>
<div *ngIf="auth.token.userRoleType=='0'" style="width:100px;margin:auto;">
  <button nz-button (click)="goBack()" style="margin-top: 16px">
    返回
  </button>
</div>
